package com.jiyun.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jiyun.pojo.DcDriver;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.math.BigDecimal;

@Mapper
public interface DriverMapper extends BaseMapper<DcDriver> {
    Integer findCarId(Integer id);

    @Select("select * from dc_driver where tel=#{tel}")
    DcDriver findDriverByTel(String tel);

    @Update("update dc_driver set status=1 where id=#{id}")
    void updateStatus(Integer id);

    @Update("update dc_driver set status=2 where id=#{id}")
    void updateStatus2(Integer id);

    @Update("update dc_driver set  cancel_num = cancel_num+1 where id=#{id}")
    void cancelOrderCount(Integer id);

    Integer findCount(Integer id);

    void updateDriverMoney(Integer id);

    void saveDriverMaoney(Integer id, BigDecimal totalAssets);
}
